﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TGInspect
{
    [Flags]
    public enum InNum
    {
        AlignCyl = 0,
        AlignCyl1,
        Adjust = 16,
        UpDownCyl = 32,
    }

    public class Input : IUpdate
    {
        const int ModPerNum = 16;
        public int[] InputBuf;
        int ModNum;

        public Input(int modNum)
        {
            this.ModNum = modNum;
            InputBuf = new int[this.ModNum];
        }

        public bool Get(InNum inNum)
        {
            int bufNum = (int)inNum / ModPerNum;
            int loc = (int)inNum % ModPerNum;

            if (bufNum >= ModNum) { throw new Exception("Input bufum >= ModNum!!"); }
            if ((InputBuf[bufNum] & (0x1 << loc)) != 0)
                return true;
            else
                return false;
        }
 
        public void Update()
        {

        }
    }
}
